/**
 * Created by Administrator on 2017/4/17 0017.
 */
$(function () {

    // =======筛选框点击效果=======
    var filterBtn = $('#filter-box li');
    filterBtn.click(function () {
        $(this).addClass('active').siblings().removeClass('active');
    });



    //========点击全选按钮，让设备列表里的复选框与全选同步=======
    var $chooseAll = $('#chooseAll');
    var $chooseDevice = $('input[name="chooseDevice"]:checkbox');
    $chooseAll.click(function () {
        if(this.checked){
            $chooseDevice.each(function(){this.checked= true});
        }else {
            $chooseDevice.each(function(){this.checked= false});
        }
    });



    //==========布局转换=========
    var $gridLayout = $('.grid-layout');
    var $listLayout = $('.list-layout');
    $('.gridLi').click(function () {
        $(this).addClass('active').siblings().removeClass('active');
        $gridLayout.css({'display': 'block'});
        $listLayout.css({'display': 'none'});
    });
    $('.listLi').click(function () {
        $(this).addClass('active').siblings().removeClass('active');
        $gridLayout.css({'display': 'none'});
        $listLayout.css({'display': 'block'});
    });


    //=======关闭提示栏======
    var $closeTip = $('.tip-right .close-icon');
    $closeTip.click(function () {
        $('.tips-box').slideUp();
    })


})





